<template>
    <div>
     <div class="mui-numbox" data-numbox-min='1' :data-numbox-max='100'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
                    <!-- 监听input -->
					<input id="test" class="mui-input-numbox" type="number" :value="initcount" @change="countChange" ref="number"/>
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				</div>
    </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";
export default {
    data() {
        return {
            
        }
    },
    // 当前元素渲染
    mounted(){
     this.mui()
    },
    methods:{
        mui(){
           mui(".mui-numbox").numbox()
        },

        countChange(){
      // console.log(this.$refs.number.value);
      // this.$emit("getcount",parseInt(this.$refs.number.value))
      // console.log(this.$refs.number);
       this.$store.commit("uodateGoodsinfo",{id:this.geoid,count:this.$refs.number.value})
    //    console.log({id:this.geoid,count:this.$refs.number.value});
       
        }
       
    },
     props:["initcount","geoid"],
    // watch:{
    //     "max":function (newval,ondval) {
    //         mui(".mui-numbox").numbox().setOption('max',newval)
    //     }
    // }
}
</script>
<style lang="scss">
.mui-numbox{
   padding: 0 35px;
}
</style>
